<!DOCTYPE HTML>

<html lang="en">
<head>

<title>WebSecurityConfigurerAdapter (spring-security-docs 5.6.3 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="WebSecurityConfigurerAdapter (spring-security-docs 5.6.3 API)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">

<div class="topNav"><a id="navbar.top">

</a>
<div class="skipNav"><a href="WebSecurityConfigurerAdapter.html#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">

</a></div>

</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>

<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.springframework.security.config.annotation.web.configuration</a></div>
<h2 title="Class WebSecurityConfigurerAdapter" class="title">Class WebSecurityConfigurerAdapter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="../../SecurityConfigurer.html" title="interface in org.springframework.security.config.annotation">SecurityConfigurer</a>&lt;javax.servlet.Filter,&#8203;<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&gt;</code>, <code><a href="../WebSecurityConfigurer.html" title="interface in org.springframework.security.config.annotation.web">WebSecurityConfigurer</a>&lt;<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&gt;</code></dd>
</dl>
<hr>
<pre>@Order(100)
public abstract class <span class="typeNameLabel">WebSecurityConfigurerAdapter</span>
extends java.lang.Object
implements <a href="../WebSecurityConfigurer.html" title="interface in org.springframework.security.config.annotation.web">WebSecurityConfigurer</a>&lt;<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&gt;</pre>
<div class="block">Provides a convenient base class for creating a <a href="../WebSecurityConfigurer.html" title="interface in org.springframework.security.config.annotation.web"><code>WebSecurityConfigurer</code></a> instance.
The implementation allows customization by overriding methods.
<p>
Will automatically apply the result of looking up <a href="../configurers/AbstractHttpConfigurer.html" title="class in org.springframework.security.config.annotation.web.configurers"><code>AbstractHttpConfigurer</code></a> from
<code>SpringFactoriesLoader</code> to allow developers to extend the defaults. To do this,
you must create a class that extends AbstractHttpConfigurer and then create a file in
the classpath at "META-INF/spring.factories" that looks something like:
</p>
<pre> org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer = sample.MyClassThatExtendsAbstractHttpConfigurer
 </pre> If you have multiple classes that should be added you can use "," to separate
the values. For example:
<pre> org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer = sample.MyClassThatExtendsAbstractHttpConfigurer, sample.OtherThatExtendsAbstractHttpConfigurer
 </pre></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="EnableWebSecurity.html" title="annotation in org.springframework.security.config.annotation.web.configuration"><code>EnableWebSecurity</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">

</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colSecond" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#%3Cinit%3E()">WebSecurityConfigurerAdapter</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates an instance with the default configuration enabled.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected </code></td>
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#%3Cinit%3E(boolean)">WebSecurityConfigurerAdapter</a></span>&#8203;(boolean&nbsp;disableDefaults)</code></th>
<td class="colLast">
<div class="block">Creates an instance which allows specifying if the default configuration should be
enabled.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">

</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication">AuthenticationManager</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#authenticationManager()">authenticationManager</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> to use.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication">AuthenticationManager</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#authenticationManagerBean()">authenticationManagerBean</a></span>()</code></th>
<td class="colLast">
<div class="block">Override this method to expose the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> from
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)"><code>configure(AuthenticationManagerBuilder)</code></a> to be exposed as a Bean.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)">configure</a></span>&#8203;(<a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders">AuthenticationManagerBuilder</a>&nbsp;auth)</code></th>
<td class="colLast">
<div class="block">Used by the default implementation of <a href="WebSecurityConfigurerAdapter.html#authenticationManager()"><code>authenticationManager()</code></a> to attempt
to obtain an <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.web.builders.HttpSecurity)">configure</a></span>&#8203;(<a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">HttpSecurity</a>&nbsp;http)</code></th>
<td class="colLast">
<div class="block">Override this method to configure the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.web.builders.WebSecurity)">configure</a></span>&#8203;(<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&nbsp;web)</code></th>
<td class="colLast">
<div class="block">Override this method to configure <a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>WebSecurity</code></a>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected org.springframework.context.ApplicationContext</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#getApplicationContext()">getApplicationContext</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the ApplicationContext</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">HttpSecurity</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#getHttp()">getHttp</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a> or returns the current instance</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#init(org.springframework.security.config.annotation.web.builders.WebSecurity)">init</a></span>&#8203;(<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&nbsp;web)</code></th>
<td class="colLast">
<div class="block">Initialize the <a href="../../SecurityBuilder.html" title="interface in org.springframework.security.config.annotation"><code>SecurityBuilder</code></a>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#setApplicationContext(org.springframework.context.ApplicationContext)">setApplicationContext</a></span>&#8203;(org.springframework.context.ApplicationContext&nbsp;context)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#setAuthenticationConfiguration(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration)">setAuthenticationConfiguration</a></span>&#8203;(<a href="../../authentication/configuration/AuthenticationConfiguration.html" title="class in org.springframework.security.config.annotation.authentication.configuration">AuthenticationConfiguration</a>&nbsp;authenticationConfiguration)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#setContentNegotationStrategy(org.springframework.web.accept.ContentNegotiationStrategy)">setContentNegotationStrategy</a></span>&#8203;(org.springframework.web.accept.ContentNegotiationStrategy&nbsp;contentNegotiationStrategy)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor)">setObjectPostProcessor</a></span>&#8203;(<a href="../../ObjectPostProcessor.html" title="interface in org.springframework.security.config.annotation">ObjectPostProcessor</a>&lt;java.lang.Object&gt;&nbsp;objectPostProcessor)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#setTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver)">setTrustResolver</a></span>&#8203;(<a href="../../../../authentication/AuthenticationTrustResolver.html" title="interface in org.springframework.security.authentication">AuthenticationTrustResolver</a>&nbsp;trustResolver)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#userDetailsService()">userDetailsService</a></span>()</code></th>
<td class="colLast">
<div class="block">Allows modifying and accessing the <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> from
<a href="WebSecurityConfigurerAdapter.html#userDetailsServiceBean()"><code>userDetailsServiceBean()</code></a> without interacting with the
<code>ApplicationContext</code>.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="WebSecurityConfigurerAdapter.html#userDetailsServiceBean()">userDetailsServiceBean</a></span>()</code></th>
<td class="colLast">
<div class="block">Override this method to expose a <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> created from
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)"><code>configure(AuthenticationManagerBuilder)</code></a> as a bean.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">

</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">

</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>WebSecurityConfigurerAdapter</h4>
<pre>protected&nbsp;WebSecurityConfigurerAdapter()</pre>
<div class="block">Creates an instance with the default configuration enabled.</div>
</li>
</ul>
<a id="&lt;init&gt;(boolean)">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>WebSecurityConfigurerAdapter</h4>
<pre>protected&nbsp;WebSecurityConfigurerAdapter&#8203;(boolean&nbsp;disableDefaults)</pre>
<div class="block">Creates an instance which allows specifying if the default configuration should be
enabled. Disabling the default configuration should be considered more advanced
usage as it requires more understanding of how the framework is implemented.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>disableDefaults</code> - true if the default configuration should be disabled, else
false</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">

</a>
<h3>Method Detail</h3>
<a id="configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;configure&#8203;(<a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders">AuthenticationManagerBuilder</a>&nbsp;auth)
                  throws java.lang.Exception</pre>
<div class="block">Used by the default implementation of <a href="WebSecurityConfigurerAdapter.html#authenticationManager()"><code>authenticationManager()</code></a> to attempt
to obtain an <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a>. If overridden, the
<a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders"><code>AuthenticationManagerBuilder</code></a> should be used to specify the
<a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a>.
<p>
The <a href="WebSecurityConfigurerAdapter.html#authenticationManagerBean()"><code>authenticationManagerBean()</code></a> method can be used to expose the resulting
<a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> as a Bean. The <a href="WebSecurityConfigurerAdapter.html#userDetailsServiceBean()"><code>userDetailsServiceBean()</code></a> can
be used to expose the last populated <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> that is created
with the <a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders"><code>AuthenticationManagerBuilder</code></a> as a Bean. The
<a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> will also automatically be populated on
<a href="../../AbstractConfiguredSecurityBuilder.html#getSharedObject(java.lang.Class)"><code>AbstractConfiguredSecurityBuilder.getSharedObject(Class)</code></a> for use with other
<a href="../configurers/SecurityContextConfigurer.html" title="class in org.springframework.security.config.annotation.web.configurers"><code>SecurityContextConfigurer</code></a> (i.e. RememberMeConfigurer )
</p>
<p>
For example, the following configuration could be used to register in memory
authentication that exposes an in memory <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a>:
</p>
<pre> &#064;Override
 protected void configure(AuthenticationManagerBuilder auth) {
        auth
        // enable in memory based authentication with a user named
        // &quot;user&quot; and &quot;admin&quot;
        .inMemoryAuthentication().withUser(&quot;user&quot;).password(&quot;password&quot;).roles(&quot;USER&quot;).and()
                        .withUser(&quot;admin&quot;).password(&quot;password&quot;).roles(&quot;USER&quot;, &quot;ADMIN&quot;);
 }

 // Expose the UserDetailsService as a Bean
 &#064;Bean
 &#064;Override
 public UserDetailsService userDetailsServiceBean() throws Exception {
        return super.userDetailsServiceBean();
 }

 </pre></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>auth</code> - the <a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders"><code>AuthenticationManagerBuilder</code></a> to use</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="getHttp()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getHttp</h4>
<pre class="methodSignature">protected final&nbsp;<a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">HttpSecurity</a>&nbsp;getHttp()
                              throws java.lang.Exception</pre>
<div class="block">Creates the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a> or returns the current instance</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="authenticationManagerBean()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>authenticationManagerBean</h4>
<pre class="methodSignature">public&nbsp;<a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication">AuthenticationManager</a>&nbsp;authenticationManagerBean()
                                                throws java.lang.Exception</pre>
<div class="block">Override this method to expose the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> from
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)"><code>configure(AuthenticationManagerBuilder)</code></a> to be exposed as a Bean. For
example:
<pre> &#064;Bean(name name="myAuthenticationManager")
 &#064;Override
 public AuthenticationManager authenticationManagerBean() throws Exception {
     return super.authenticationManagerBean();
 }
 </pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="authenticationManager()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>authenticationManager</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication">AuthenticationManager</a>&nbsp;authenticationManager()
                                               throws java.lang.Exception</pre>
<div class="block">Gets the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> to use. The default strategy is if
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)"><code>configure(AuthenticationManagerBuilder)</code></a> method is overridden to use the
<a href="../../authentication/builders/AuthenticationManagerBuilder.html" title="class in org.springframework.security.config.annotation.authentication.builders"><code>AuthenticationManagerBuilder</code></a> that was passed in. Otherwise, autowire the
<a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> by type.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../authentication/AuthenticationManager.html" title="interface in org.springframework.security.authentication"><code>AuthenticationManager</code></a> to use</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="userDetailsServiceBean()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>userDetailsServiceBean</h4>
<pre class="methodSignature">public&nbsp;<a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>&nbsp;userDetailsServiceBean()
                                          throws java.lang.Exception</pre>
<div class="block">Override this method to expose a <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> created from
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)"><code>configure(AuthenticationManagerBuilder)</code></a> as a bean. In general only the
following override should be done of this method:
<pre> &#064;Bean(name = &quot;myUserDetailsService&quot;)
 // any or no name specified is allowed
 &#064;Override
 public UserDetailsService userDetailsServiceBean() throws Exception {
        return super.userDetailsServiceBean();
 }
 </pre>
To change the instance returned, developers should change
<a href="WebSecurityConfigurerAdapter.html#userDetailsService()"><code>userDetailsService()</code></a> instead</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="WebSecurityConfigurerAdapter.html#userDetailsService()"><code>userDetailsService()</code></a></dd>
</dl>
</li>
</ul>
<a id="userDetailsService()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>userDetailsService</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>&nbsp;userDetailsService()</pre>
<div class="block">Allows modifying and accessing the <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> from
<a href="WebSecurityConfigurerAdapter.html#userDetailsServiceBean()"><code>userDetailsServiceBean()</code></a> without interacting with the
<code>ApplicationContext</code>. Developers should override this method when changing
the instance of <a href="WebSecurityConfigurerAdapter.html#userDetailsServiceBean()"><code>userDetailsServiceBean()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../core/userdetails/UserDetailsService.html" title="interface in org.springframework.security.core.userdetails"><code>UserDetailsService</code></a> to use</dd>
</dl>
</li>
</ul>
<a id="init(org.springframework.security.config.annotation.web.builders.WebSecurity)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;init&#8203;(<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&nbsp;web)
          throws java.lang.Exception</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../SecurityConfigurer.html#init(B)">SecurityConfigurer</a></code></span></div>
<div class="block">Initialize the <a href="../../SecurityBuilder.html" title="interface in org.springframework.security.config.annotation"><code>SecurityBuilder</code></a>. Here only shared state should be created
and modified, but not properties on the <a href="../../SecurityBuilder.html" title="interface in org.springframework.security.config.annotation"><code>SecurityBuilder</code></a> used for building
the object. This ensures that the <a href="../../SecurityConfigurer.html#configure(B)"><code>SecurityConfigurer.configure(SecurityBuilder)</code></a> method uses
the correct shared objects when building. Configurers should be applied here.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../SecurityConfigurer.html#init(B)">init</a></code>&nbsp;in interface&nbsp;<code><a href="../../SecurityConfigurer.html" title="interface in org.springframework.security.config.annotation">SecurityConfigurer</a>&lt;javax.servlet.Filter,&#8203;<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&gt;</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="configure(org.springframework.security.config.annotation.web.builders.WebSecurity)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;configure&#8203;(<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&nbsp;web)
               throws java.lang.Exception</pre>
<div class="block">Override this method to configure <a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>WebSecurity</code></a>. For example, if you wish to
ignore certain requests.
Endpoints specified in this method will be ignored by Spring Security, meaning it
will not protect them from CSRF, XSS, Clickjacking, and so on.
Instead, if you want to protect endpoints against common vulnerabilities, then see
<a href="WebSecurityConfigurerAdapter.html#configure(org.springframework.security.config.annotation.web.builders.HttpSecurity)"><code>configure(HttpSecurity)</code></a> and the <a href="../builders/HttpSecurity.html#authorizeRequests()"><code>HttpSecurity.authorizeRequests()</code></a>
configuration method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../SecurityConfigurer.html#configure(B)">configure</a></code>&nbsp;in interface&nbsp;<code><a href="../../SecurityConfigurer.html" title="interface in org.springframework.security.config.annotation">SecurityConfigurer</a>&lt;javax.servlet.Filter,&#8203;<a href="../builders/WebSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">WebSecurity</a>&gt;</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a id="configure(org.springframework.security.config.annotation.web.builders.HttpSecurity)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;configure&#8203;(<a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders">HttpSecurity</a>&nbsp;http)
                  throws java.lang.Exception</pre>
<div class="block">Override this method to configure the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a>. Typically subclasses
should not invoke this method by calling super as it may override their
configuration. The default configuration is:
<pre> http.authorizeRequests().anyRequest().authenticated().and().formLogin().and().httpBasic();
 </pre>
Any endpoint that requires defense against common vulnerabilities can be specified
here, including public ones. See <a href="../builders/HttpSecurity.html#authorizeRequests()"><code>HttpSecurity.authorizeRequests()</code></a> and the
`permitAll()` authorization rule for more details on public endpoints.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>http</code> - the <a href="../builders/HttpSecurity.html" title="class in org.springframework.security.config.annotation.web.builders"><code>HttpSecurity</code></a> to modify</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - if an error occurs</dd>
</dl>
</li>
</ul>
<a id="getApplicationContext()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getApplicationContext</h4>
<pre class="methodSignature">protected final&nbsp;org.springframework.context.ApplicationContext&nbsp;getApplicationContext()</pre>
<div class="block">Gets the ApplicationContext</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the context</dd>
</dl>
</li>
</ul>
<a id="setApplicationContext(org.springframework.context.ApplicationContext)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setApplicationContext</h4>
<pre class="methodSignature">@Autowired
public&nbsp;void&nbsp;setApplicationContext&#8203;(org.springframework.context.ApplicationContext&nbsp;context)</pre>
</li>
</ul>
<a id="setTrustResolver(org.springframework.security.authentication.AuthenticationTrustResolver)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setTrustResolver</h4>
<pre class="methodSignature">@Autowired(required=false)
public&nbsp;void&nbsp;setTrustResolver&#8203;(<a href="../../../../authentication/AuthenticationTrustResolver.html" title="interface in org.springframework.security.authentication">AuthenticationTrustResolver</a>&nbsp;trustResolver)</pre>
</li>
</ul>
<a id="setContentNegotationStrategy(org.springframework.web.accept.ContentNegotiationStrategy)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setContentNegotationStrategy</h4>
<pre class="methodSignature">@Autowired(required=false)
public&nbsp;void&nbsp;setContentNegotationStrategy&#8203;(org.springframework.web.accept.ContentNegotiationStrategy&nbsp;contentNegotiationStrategy)</pre>
</li>
</ul>
<a id="setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setObjectPostProcessor</h4>
<pre class="methodSignature">@Autowired
public&nbsp;void&nbsp;setObjectPostProcessor&#8203;(<a href="../../ObjectPostProcessor.html" title="interface in org.springframework.security.config.annotation">ObjectPostProcessor</a>&lt;java.lang.Object&gt;&nbsp;objectPostProcessor)</pre>
</li>
</ul>
<a id="setAuthenticationConfiguration(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration)">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setAuthenticationConfiguration</h4>
<pre class="methodSignature">@Autowired
public&nbsp;void&nbsp;setAuthenticationConfiguration&#8203;(<a href="../../authentication/configuration/AuthenticationConfiguration.html" title="class in org.springframework.security.config.annotation.authentication.configuration">AuthenticationConfiguration</a>&nbsp;authenticationConfiguration)</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>

<footer role="contentinfo">
<nav role="navigation">

<div class="bottomNav"><a id="navbar.bottom">

</a>
<div class="skipNav"><a href="WebSecurityConfigurerAdapter.html#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="WebSecurityConfigurerAdapter.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">

</a></div>

</nav>
</footer>
<script>if (window.parent == window) {(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-2728886-23', 'auto', {'siteSpeedSampleRate': 100});ga('send', 'pageview');}</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"7040f4377cd297cf","token":"bffcb8a918ae4755926f76178bfbd26b","version":"2021.12.0","si":100}' crossorigin="anonymous"></script>
</body>
</html>
